/**
 *      Copyright 2008 Augusto Campos <b>augcampos&#64augcampos.pt></b><br>
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 3 of the License.
 *      <p>
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *      <p>
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
package com.augcampos.gui;

import com.augcampos.core.n501070324_Intervencao;
import com.augcampos.core.n501070324_Intervencoes;
import com.augcampos.core.n501070324_PedidoAssistencia;
import com.augcampos.core.n501070324_PedidosAssistencia;
import com.augcampos.core.n501070324_Pessoas;
import com.augcampos.core.n501070324_Tecnico;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Date;
import java.util.LinkedList;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;

/**
 *
 ** @author Augusto Campos <b>augcampos@augcampos.pt</b>
 */
public class n501070324_InterventionForm extends javax.swing.JInternalFrame {

    private n501070324_Intervencoes intervencoesLnk;
    private n501070324_Pessoas pessoasLnk;
    private n501070324_PedidosAssistencia paLink;
    private LinkedList<n501070324_PedidoAssistencia> allPA;
    private LinkedList<n501070324_PedidoAssistencia> openPA = new LinkedList<n501070324_PedidoAssistencia>();

    /** Creates new form n501070324_UserForm
     * @param it
     * @param pa
     * @param ps
     */
    public n501070324_InterventionForm(n501070324_Intervencoes it, n501070324_Pessoas ps, n501070324_PedidosAssistencia pa) {
        this.intervencoesLnk = it;
        this.pessoasLnk = ps;
        this.paLink = pa;
        initComponents();


        tblList.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseClicked(MouseEvent e) {
                if (e.getClickCount() == 2) {
                    editData();
                }
            }
        });

        tblList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {

            public void valueChanged(ListSelectionEvent e) {
                refreshDetails(getSelect());
            }
        });


        refreshData();
        refreshDetails(getSelect());
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        tbActions = new javax.swing.JToolBar();
        btAdd = new javax.swing.JButton();
        btEdit = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JToolBar.Separator();
        btDelete = new javax.swing.JButton();
        tabsMain = new javax.swing.JTabbedPane();
        pnList = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblList = new javax.swing.JTable();
        pnDetails = new javax.swing.JPanel();
        lblNumero = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        btSave = new javax.swing.JButton();
        btCancel = new javax.swing.JButton();
        cbPS = new javax.swing.JComboBox();
        jLabel2 = new javax.swing.JLabel();
        frfData = new javax.swing.JFormattedTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        txtDescricao = new javax.swing.JTextArea();
        jLabel6 = new javax.swing.JLabel();
        ckResolvido = new javax.swing.JCheckBox();
        cbTecnico = new javax.swing.JComboBox();
        txtDuracao = new javax.swing.JTextField();

        setClosable(true);
        setTitle("Intervenções");
        setMaximumSize(new java.awt.Dimension(404, 171));
        setMinimumSize(new java.awt.Dimension(404, 171));
        getContentPane().setLayout(new java.awt.GridBagLayout());

        tbActions.setFloatable(false);
        tbActions.setRollover(true);
        tbActions.setFocusable(false);
        tbActions.setMinimumSize(new java.awt.Dimension(50, 50));
        tbActions.setPreferredSize(new java.awt.Dimension(25, 25));

        btAdd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/augcampos/gui/webdev-add-48x48.png"))); // NOI18N
        btAdd.setText("Adicionar");
        btAdd.setToolTipText("");
        btAdd.setFocusable(false);
        btAdd.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        btAdd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btAddActionPerformed(evt);
            }
        });
        tbActions.add(btAdd);

        btEdit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/augcampos/gui/webdev-config-48x48.png"))); // NOI18N
        btEdit.setText("Editar");
        btEdit.setToolTipText("");
        btEdit.setFocusable(false);
        btEdit.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        btEdit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btEditActionPerformed(evt);
            }
        });
        tbActions.add(btEdit);
        tbActions.add(jSeparator1);

        btDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/augcampos/gui/webdev-remove-48x48.png"))); // NOI18N
        btDelete.setText("Apagar");
        btDelete.setToolTipText("");
        btDelete.setFocusable(false);
        btDelete.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        btDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btDeleteActionPerformed(evt);
            }
        });
        tbActions.add(btDelete);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.weightx = 100.0;
        getContentPane().add(tbActions, gridBagConstraints);

        pnList.setLayout(new java.awt.GridBagLayout());

        tblList.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Nr", "P.S.", "Data", "Técnico", "Descrição", "Duração", "Resolvido"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.String.class, java.lang.Integer.class, java.lang.Boolean.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, true, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tblList.setColumnSelectionAllowed(true);
        tblList.setDoubleBuffered(true);
        tblList.setOpaque(false);
        tblList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane1.setViewportView(tblList);
        tblList.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);
        tblList.getColumnModel().getColumn(0).setPreferredWidth(10);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 100.0;
        gridBagConstraints.weighty = 100.0;
        pnList.add(jScrollPane1, gridBagConstraints);

        tabsMain.addTab("Listagem", pnList);

        lblNumero.setText("0");

        jLabel1.setText("Numero :");

        btSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/augcampos/gui/webdev-ok-48x48.png"))); // NOI18N
        btSave.setText("Gravar");
        btSave.setMaximumSize(new java.awt.Dimension(100, 50));
        btSave.setMinimumSize(new java.awt.Dimension(100, 50));
        btSave.setPreferredSize(new java.awt.Dimension(150, 50));
        btSave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btSaveActionPerformed(evt);
            }
        });

        btCancel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/augcampos/gui/webdev-cancel-48x48.png"))); // NOI18N
        btCancel.setText("Cancelar");
        btCancel.setMaximumSize(new java.awt.Dimension(100, 26));
        btCancel.setMinimumSize(new java.awt.Dimension(100, 26));
        btCancel.setPreferredSize(new java.awt.Dimension(150, 50));
        btCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btCancelActionPerformed(evt);
            }
        });

        cbPS.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        jLabel2.setText("P.Suporte :");

        frfData.setText("9999/99/99");

        jLabel3.setText("Data :");

        jLabel4.setText("Técnico :");

        jLabel5.setText("Descrição :");

        txtDescricao.setColumns(20);
        txtDescricao.setRows(5);
        jScrollPane2.setViewportView(txtDescricao);

        jLabel6.setText("Duração :");

        ckResolvido.setText("Resolvido");

        cbTecnico.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        txtDuracao.setText("9");
        txtDuracao.setMinimumSize(new java.awt.Dimension(70, 24));

        javax.swing.GroupLayout pnDetailsLayout = new javax.swing.GroupLayout(pnDetails);
        pnDetails.setLayout(pnDetailsLayout);
        pnDetailsLayout.setHorizontalGroup(
            pnDetailsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnDetailsLayout.createSequentialGroup()
                .addGap(12, 12, 12)
                .addGroup(pnDetailsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel6)
                    .addComponent(jLabel5)
                    .addComponent(jLabel1)
                    .addComponent(jLabel3))
                .addGap(49, 49, 49)
                .addGroup(pnDetailsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnDetailsLayout.createSequentialGroup()
                        .addGroup(pnDetailsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnDetailsLayout.createSequentialGroup()
                                .addComponent(btSave, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(btCancel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(pnDetailsLayout.createSequentialGroup()
                                .addGroup(pnDetailsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(frfData)
                                    .addComponent(lblNumero, javax.swing.GroupLayout.DEFAULT_SIZE, 78, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(pnDetailsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel4)
                                    .addComponent(jLabel2))
                                .addGap(8, 8, 8)
                                .addGroup(pnDetailsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(cbTecnico, 0, 289, Short.MAX_VALUE)
                                    .addComponent(cbPS, 0, 289, Short.MAX_VALUE)))
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 451, Short.MAX_VALUE))
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnDetailsLayout.createSequentialGroup()
                        .addComponent(txtDuracao, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 140, Short.MAX_VALUE)
                        .addComponent(ckResolvido)
                        .addGap(170, 170, 170))))
        );
        pnDetailsLayout.setVerticalGroup(
            pnDetailsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnDetailsLayout.createSequentialGroup()
                .addGap(36, 36, 36)
                .addGroup(pnDetailsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(pnDetailsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lblNumero)
                        .addComponent(jLabel1))
                    .addGroup(pnDetailsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(cbPS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel2)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnDetailsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnDetailsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(frfData, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel3))
                    .addGroup(pnDetailsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(cbTecnico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel4)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnDetailsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel5)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(pnDetailsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnDetailsLayout.createSequentialGroup()
                        .addGap(23, 23, 23)
                        .addComponent(jLabel6))
                    .addGroup(pnDetailsLayout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(ckResolvido))
                    .addGroup(pnDetailsLayout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(txtDuracao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 80, Short.MAX_VALUE)
                .addGroup(pnDetailsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btCancel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btSave, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(36, 36, 36))
        );

        tabsMain.addTab("Detalhes", pnDetails);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 100.0;
        gridBagConstraints.weighty = 100.0;
        getContentPane().add(tabsMain, gridBagConstraints);
        tabsMain.getAccessibleContext().setAccessibleName("");

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btAddActionPerformed
        addData();
    }//GEN-LAST:event_btAddActionPerformed

    private void btEditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btEditActionPerformed
        editData();
    }//GEN-LAST:event_btEditActionPerformed

    private void btSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btSaveActionPerformed
        saveData();
}//GEN-LAST:event_btSaveActionPerformed

    private void btDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btDeleteActionPerformed
        deleteData();
    }//GEN-LAST:event_btDeleteActionPerformed

    private void btCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btCancelActionPerformed
        cancelData();
    }//GEN-LAST:event_btCancelActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    protected javax.swing.JButton btAdd;
    protected javax.swing.JButton btCancel;
    protected javax.swing.JButton btDelete;
    protected javax.swing.JButton btEdit;
    protected javax.swing.JButton btSave;
    protected javax.swing.JComboBox cbPS;
    protected javax.swing.JComboBox cbTecnico;
    protected javax.swing.JCheckBox ckResolvido;
    protected javax.swing.JFormattedTextField frfData;
    protected javax.swing.JLabel jLabel1;
    protected javax.swing.JLabel jLabel2;
    protected javax.swing.JLabel jLabel3;
    protected javax.swing.JLabel jLabel4;
    protected javax.swing.JLabel jLabel5;
    protected javax.swing.JLabel jLabel6;
    protected javax.swing.JScrollPane jScrollPane1;
    protected javax.swing.JScrollPane jScrollPane2;
    protected javax.swing.JToolBar.Separator jSeparator1;
    protected javax.swing.JLabel lblNumero;
    protected javax.swing.JPanel pnDetails;
    protected javax.swing.JPanel pnList;
    protected javax.swing.JTabbedPane tabsMain;
    protected javax.swing.JToolBar tbActions;
    protected javax.swing.JTable tblList;
    protected javax.swing.JTextArea txtDescricao;
    protected javax.swing.JTextField txtDuracao;
    // End of variables declaration//GEN-END:variables

    private void refreshData() {
        javax.swing.table.DefaultTableModel dtm = (javax.swing.table.DefaultTableModel) tblList.getModel();

        while (dtm.getRowCount() > 0) {
            dtm.removeRow(0);
        }
        for (n501070324_Intervencao ii : intervencoesLnk.getList()) {
            dtm.addRow(new Object[]{ii.getNumero(), ii.getPedidoSuporte(), ii.getDataStr(), ii.getTecnico(), ii.getDescricao(), ii.getDuracao(), ii.isResolvido()});
        }

        cbTecnico.removeAllItems();
        for (n501070324_Tecnico t : pessoasLnk.getTecnics()) {
            cbTecnico.addItem(t);
        }

        allPA = paLink.getList();
        for (n501070324_PedidoAssistencia pa : paLink.getList()) {
            boolean insert = true;
            // only add if is not resolved
            for (n501070324_Intervencao i : intervencoesLnk.getList(pa.getNumero())) {
                if (i.isResolvido()) {
                    insert = false;
                    break;
                }
            }
            if (insert) {
                openPA.add(pa);
            }
        }


    }

    private void addData() {
        if (tabsMain.getSelectedIndex() == 0) {
            tabsMain.setSelectedIndex(1);
        }

        cbPS.removeAllItems();
        for (n501070324_PedidoAssistencia pedidoAssistencia : openPA) {
            cbPS.addItem(pedidoAssistencia);
        }

        lblNumero.setText("<Novo>");
        frfData.setText("");
        cbPS.setSelectedIndex(-1);
        cbTecnico.setSelectedIndex(-1);
        txtDescricao.setText("");
        txtDuracao.setText("0");
        ckResolvido.setSelected(false);

        frfData.requestFocus();

    }

    private void editData() {
        if (tabsMain.getSelectedIndex() == 0) {
            tabsMain.setSelectedIndex(1);
        }

        cbPS.removeAllItems();
        for (n501070324_PedidoAssistencia pedidoAssistencia : allPA) {
            cbPS.addItem(pedidoAssistencia);
        }

        refreshDetails(getSelect());
        frfData.requestFocus();

    }

    private void deleteData() {
        intervencoesLnk.remove(getSelect());
        refreshData();
    }

    private void saveData() {

        n501070324_Intervencao intervencao;
        if (lblNumero.getText().equalsIgnoreCase("<Novo>")) {
            intervencao = new n501070324_Intervencao();
            intervencoesLnk.add(intervencao);
        } else {
            intervencao = getSelect();
        }
        intervencao.setData(new Date(frfData.getText()));
        intervencao.setPedidoSuporte(((n501070324_PedidoAssistencia) cbPS.getSelectedItem()).getNumero());
        intervencao.setTecnico(((n501070324_Tecnico) cbTecnico.getSelectedItem()).getNumero());
        intervencao.setDescricao(txtDescricao.getText());
        intervencao.setDuracao(Integer.valueOf(txtDuracao.getText()));
        intervencao.setResolvido(ckResolvido.isSelected());

        refreshData();

        refreshDetails(intervencao);
    }

    private void cancelData() {
        refreshDetails(getSelect());
    }

    private void refreshDetails(n501070324_Intervencao ii) {

        if (ii != null) {
            lblNumero.setText("" + ii.getNumero());
            frfData.setText(ii.getDataStr());
            cbPS.setSelectedItem(paLink.getPedido(ii.getNumero()));
            cbTecnico.setSelectedItem(pessoasLnk.getTecnic(ii.getTecnico()));
            txtDescricao.setText(ii.getDescricao());
            txtDuracao.setText("" + ii.getDuracao());
            ckResolvido.setSelected(ii.isResolvido());
        }
    }

    private n501070324_Intervencao getSelect() {
        if (tblList.getRowCount() < 1) {
            return null;
        }
        if (tblList.getSelectedRow() == -1) {
            tblList.setRowSelectionInterval(0, 0);
        }
        int id = Integer.valueOf(tblList.getModel().getValueAt(tblList.getSelectedRow(), 0).toString());


        return intervencoesLnk.geIntervencao(id);
    }
}
